In a graphics processing environment, image filtering allows for improved image quality in a rendered display. Two common filtering approaches are a multi-tap filter which is used for high-quality video or anti-aliased text and pixel shader code and two by two (bi-linear) filtering for a texture maps. Bilinear filters adjust the color of a pixel by computing a weighted average of a 2×2 array of texels that lie nearest to the center of the calculated pixel. The weighted average color is then assigned to the pixel. Multi-tap filters are generally expensive in terms of not only components for performing these operations, but also in processing time. A multi-tap filter complicates a standard graphics processing pipeline through requiring further processing steps and extended computation time.
A typical three-dimensional graphics processing system natively provides a two-by-two bilinear filter. A single address fetch by the filter results in 4 texels being returned. When an application requires a higher level of taps (higher level filtering), such as a 4×4 filter, this native bilinear filter is inadequate.
A solution to overcome the limitations of the native bilinear filter is utilizing pure pixel shader code. In this embodiment, a pixel shader that includes one or more ALUs includes specific code, such as executable instructions operated on a graphics processing unit, that performs the filtering functionality. In any situation where scaling occurs, such as the source and destination are not the same size or the output pixel does not align exactly to input texels, different weight sets are needed to compensate for the possible different sub-pixel alignments. Utilizing pixel shader code is generally slow because, among other things, two texture fetches are needed for each tap, one fetch is needed to fetch the weight of the texel value and one fetch is needed to fetch the texel value to be weighted. Furthermore, using pure pixel shader code, typically only “pick nearest” filtering can be used by the texture fetches, meaning that only one texel is returned for each fetch request and another 16 fetches can be required for the corresponding weights for a total of 32 fetches. It will be recognized that if a weight applies equally to four texels, fewer weight fetches may be needed (e.g., perhaps only four fetches to obtain the weights for 16 texels) however, the total number of fetches may still be unnecessarily high.
When enlarging an image, the filtering allows scaling the image and thereby creating more pixels between input texels. The quality of the scaling is largely determined by the width and height of the filter footprint. Increasing the number of taps, i.e. samples, directly increases the image quality.
Therefore, there exists a need for an improved graphics processing system allowing for higher level filtering without extensive processing overhead costs, such as by using fewer fetches utilizing existing system resources.